package com.health.income.server.controller;

import com.health.common.core.domain.R;
import com.health.common.domain.Department;
import com.health.income.server.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName DepartmentController
 * @Description 描述
 * @Author Qiu Feng
 * @Date 2025/2/26 9:23
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    // 保持现有路径不变，完整路径应为：/department/getDepartment
    @GetMapping("/getDepartment")
    public R<List<Department>> getDepartment() {
        List<Department> department = departmentService.getDepartment();
        return R.ok(department);
    }
}
